//
//  BDAlertView.h
//  BDAlertViewDemo
//
//  Created by Jaesun on 17/1/4.
//  Copyright © 2017年 S.J. All rights reserved.
//

#import <UIKit/UIKit.h>


typedef NS_ENUM(NSUInteger, BDAlertViewContentType) {
    BDAlertViewContentTypeDefault,
    BDAlertViewContentTypeSubTitle,
};


typedef void(^BDAlertViewCompletionBlock)(BOOL cancelled, NSInteger selectedIndex);

@interface BDAlertView : UIViewController

@property (nonatomic, getter = isVisible) BOOL visible;

+ (instancetype)showAlertWithTitle:(NSString *)title
                          isChoice:(BOOL)isChoice
                       otherTitles:(NSArray<NSString *> *)otherTitles
                        completion:(BDAlertViewCompletionBlock)completion;


+ (instancetype)showAlertWithTitle:(NSString *)title
                       otherTitles:(NSArray<NSString *> *)otherTitles subTitles:(NSArray<NSString *> *)subTitles
                        completion:(BDAlertViewCompletionBlock)completion;

+ (instancetype)showAlertWithTitle:(NSString *)title
                           message:(NSString *)message
                       contentView:(UIView *)view
                        completion:(BDAlertViewCompletionBlock)completion;

+ (instancetype)showAlertWithContentView:(UIView *)contentView completion:(BDAlertViewCompletionBlock)completion;



- (id)initWithContentView:(UIView *)contentView completion:(BDAlertViewCompletionBlock)completion;


@property (nonatomic, copy) BDAlertViewCompletionBlock completion;

- (void)show;

/**
 * Dismisses the receiver
 */
- (void)dismiss;


/**
 * By default the alert allows you to tap anywhere around the alert to dismiss it.
 * This method enables or disables this feature.
 */
- (void)setTapToDismissEnabled:(BOOL)enabled;

@end
